package mongodb.general.operator.nodb.services;

import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author YCWB0354
 * @since 2021/12/5 20:23:47
 */
public interface CommMongoDBInfoService {

    /**
     *插入数据
     * @param infoDto
     * @return
     * @throws Exception
     */
    Object insert(JSONObject infoDto) throws Exception;

    /**
     * 更新数据
     * @param infoDto
     * @return
     * @throws Exception
     */
    Object update(JSONObject infoDto) throws Exception;

    /**
     * 删除数据
     * @param infoDto
     * @return
     * @throws Exception
     */
    Object remove(JSONObject infoDto) throws Exception;

    /**
     * 得到单条数据
     * @param infoDto
     * @return
     * @throws Exception
     */
    Object getById(JSONObject infoDto) throws Exception;

    /**
     * 根据请求参数进行查询
     * @param infoDto
     * @return
     * @throws Exception
     */
    List<Object> getByParams(JSONObject infoDto) throws Exception;

    Page<Object> page(JSONObject infoDto) throws Exception;
}
